﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RefLocalsAndReturns
{
    class Program
    {

        //Ref Locals
        /*  static int[] ints = { 1, 2, 3, 4, 5 };

           static void Main(string[] args)
           {
               ref int number = ref ints[2];
               number*=10;
               Console.WriteLine(ints[2]);
           }*/

        //Ref Returns
        static string X = "old value";
        static ref string GetX() => ref X;

        static void Main()
        {
            ref string getx = ref GetX();
            getx = "new value";
            Console.WriteLine(X);
        }
    }
}
